<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title><%= "#{h @page_title} - " if @page_title %> <%=h @current_site && current_site.name %> - <%= 'Altered Beast'[:beast_title] %></title>
  <%= stylesheet_link_tag 'display' %>
  <%= javascript_include_tag "jquery," "jrails", :cache => 'beast' %>
<% unless @feed_icons.blank? -%>
  <% @feed_icons.each do |feed| -%>
  <%= auto_discovery_link_tag :atom, feed[:url], :title => "Subscribe to '#{feed[:title]}'" %>
  <% end -%>
<% end -%>
  <link rel="search" type="application/opensearchdescription+xml" href="http://<%= request.host_with_port %>/open_search.xml" />
</head>
<body>

<div id="header">
  <ul id="nav">
    <li><%= link_to 'Forums'[:forums_title], root_path, :rel => 'home' %></li>
    <li><%= link_to 'Users'[:users_title], users_path %></li>
    <li id="search">
      <% form_tag posts_path, :method => 'get' do -%>
        <%= text_field_tag :q, params[:q], :size => 15, :id => :search_box %>
      <% end -%>
    </li>
    <li><%= link_to_function 'Search'[:search_title], "#", :href => root_path, :id => 'search-link' %></li>

    <% if @current_site and logged_in? -%>
    <li class="login"><%=  link_to current_user.login, user_path(current_user) %></li>
    <li class="logout"><%= link_to 'Settings'[:settings_title], settings_path %></li>
    <li class="logout"><%= link_to 'Logout'[:logout_title], logout_path(:to => CGI.escape(request.request_uri)) %></li>
    <% else -%>
    <li><%= link_to 'Signup'[:signup_action], signup_path(:to => CGI.escape(request.request_uri)) %></li>
    <li><%= link_to 'Login'[:login_action], login_path(:to => CGI.escape(request.request_uri)) %></li>
    <% end -%>
  </ul>
  <h1><%= link_to 'Altered Beast'[:beast_title], root_path %></h1>
</div>
